package com.lwc.mq;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class consumer {
    /**
     * 监听队列
     * @param message
     */
    @RabbitListener(queues = "hello")
    public  void  receve(Message message){
        System.out.println("消费者收到消息了"+new String(message.getBody()));
    }

}
